#include<stdio.h>

int    getDays(int,int) ;

int main()
{
    int    year, month;

    scanf("%d%d",&year,&month);
    printf("There are %d days in month %d year %d.",getDays(year,month), month, year) ;

    return 0 ;
}
   int getDays(int year,int month)
   {    int days=0;
      if((year%400==0 || (year%4==0 && year%100!=0)) && month==2)
        {
            days=29;
            }
      else if((year%400!=0 || (year%4!=0 || year%100==0)) && month==2)
         {
             days=28;
            }
      else if(month==1 || month==3 ||month==5 || month==7 || month==8 || month==10 ||month==12)
         {
             days=31;
            }
      else
         {
             days=30;
             }
      return days;
   }
